<include file="Public:header" />
{:W('Navigation')}
<script src="__PUBLIC__/js/datepicker/WdatePicker.js"></script>
<script charset="utf-8" src="__PUBLIC__/js/editor/kindeditor.js"></script>
<script charset="utf-8" src="__PUBLIC__/js/editor/lang/zh_CN.js"></script>
<script>
	var editor;
	KindEditor.ready(function(K) {
		editor = K.create('#content', {
			uploadJson:"{:U('core/file/editor')}"
		});
	});
</script>
<div class="body-right">
	<div class="row-table">
		<div class="row-table-title">添加任务</div>
		<div class="row-table-body">
			<form class="form-horizontal " action="{:U('core/task/add')}" method="post">
				<p class="form-title">添加任务&nbsp;&nbsp;<a href="javascript:history.go(-1);">返回</a></p>
				<div class="form-group">
					<label for="name" class="col-sm-2 control-label">任务主题</label>
					<div class="col-sm-3">
						<input class="form-control" type="text" name="name">
					</div>
					<label for="name" class="col-sm-2 control-label">通知方式</label>
					<div class="col-sm-3">
						<input type="checkbox"  name="notice_type[]" checked="checked" value="1"/>站内信&nbsp;&nbsp;
						<input type="checkbox"  name="notice_type[]" value="2"/>邮件
					</div>
				</div>
				<div class="form-group">
					<label for="name" class="col-sm-2 control-label">主要执行人</label>
					<div class="col-sm-3">
						<input class="form-control" type="hidden" name="executor_id" id="executor_id" />
						<input class="form-control" type="text" readonly="true" name="executor_name" id="executor_name"/>
					</div>
				</div>
				<div class="form-group">
					<label for="name" class="col-sm-2 control-label">协同执行人</label>
					<div class="col-sm-3">
						<input class="form-control" type="hidden" name="coordinate_ids" id="coordinate_ids"/>
						<input class="form-control" type="text" readonly="true" name="coordinate_name" id="coordinate_name"/>
					</div>
				</div>
				<div class="form-group">
					<label for="name" class="col-sm-2 control-label">任务状态</label>
					<div class="col-sm-3">
						<select name="status" class="form-control">
							<option value="未开始" selected="selected">未开始</option>
							<option value="进行中">进行中</option>
							<option value="已处理">已处理</option>
							<option value="退还">退还</option>
						</select>
					</div>
					<label for="name" class="col-sm-2 control-label">任务等级</label>
					<div class="col-sm-3">
						<select name="level" class="form-control">
							<option value="1" selected="selected">普通</option>
							<option value="2">紧急</option>
							<option value="3">闲时处理</option>
						</select>
					</div>
				</div>
				<div class="form-group">
					<label for="name" class="col-sm-2 control-label">开始日期</label>
					<div class="col-sm-3">
						<input class="form-control" type="text" name="start_time" onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})"/>
					</div>
					<label for="name" class="col-sm-2 control-label">截止日期</label>
					<div class="col-sm-3">
						<input class="form-control" type="text" name="end_time" onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})"/>
					</div>
				</div>		
				<div class="form-group">
					<label for="name" class="col-sm-2 control-label">任务内容</label>
					<div class="col-sm-8">
						<textarea id="content" name="content" style="width:800px;height:300px;"></textarea>
					</div>
				</div>
				<div class="form-group">
					<label class="col-sm-2 control-label"></label>
					<div class="col-sm-3">
						<input name="submit" class="btn btn-primary" type="submit" value="保存"/>&nbsp;&nbsp;&nbsp;&nbsp;
						<input type="button" class="btn" value="取消" onclick="javascript:history.go(-1);"/>
					</div>
				</div>
			</form>
		</div>
	</div>
</div>
<script type="text/javascript">
	$('#executor_name').click(function(){
		$('#alert').modal({
			show:true,
			remote:'{:U("core/user/getSubUserDialog","self=1")}'
		});
	});
	$('#coordinate_name').click(function(){
		var executor_name = $('#executor_name').val();
		if('' == executor_name){
			alert('请先选择主要执行人！');
		}else{
			$('#alert').modal({
				show:true,
				remote:'{:U("core/user/getSubUserCBDialog")}'
			});
		}
	});
</script>
<include file="Public:alert" />
<include file="Public:footer" />